package com.jsoft.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;
import java.io.Serializable;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2025-03-14 23:30:25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor


public class User implements Serializable {
    private static final long serialVersionUID = 664950312390729358L;
    /**
     * 主键
     */
    private Integer id;
    /**
     * 用户名
     */

    @NotNull(message = "必须有用户名")
    @Size(min = 5, max = 20, message = "用户名应该在5到20位之间")
    private String username;
    /**
     * 密码
     */

    @NotNull(message = "密码不能为空")
    @Size(min = 5, max = 15, message = "密码应该在5到15位之间")
    private String password;
    /**
     * 昵称
     */
    @Size(min = 4, max = 10, message = "昵称应该在4到10位之间")
    private String nickname;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 状态:0未删除 1已删除
     */
    private Integer status;
    /**
     * 手机号
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入有效的手机号") // 手机号正则
    private String phone;
    /**
     * 邮箱
     */
    @Email
    private String email;


}

